unit Note;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DateUtils;

type
  TfrmNote = class(TForm)
    memOld: TMemo;
    memNew: TMemo;
    btnAdd: TButton;
    btnClose: TButton;
    procedure btnCloseClick(Sender: TObject);
    procedure btnAddClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmNote: TfrmNote;
  MemoStrings: Tstrings;
  LogLinje, Dt : string;
  LogAntalL: integer;

implementation

uses unit1;
{$R *.dfm}

procedure TfrmNote.btnAddClick(Sender: TObject);
var
 I : integer;
begin
frmNote.memOld.Clear;
MemoStrings := frmNote.memNew.Lines;
frmNote.memOld.Lines.AddStrings(MemoStrings);
Dt :=  FloatToStr(DaysBetween(Now,Athen)) + ':' + FloatToStr(HourOf(OverTidVis)) + ':' + FloatToStr(MinuteOf(OverTidVis)) + ':' + FloatToStr(SecondOf(OverTidVis));
LogAntalL := frmNote.memOld.Lines.Count;
if LogAntalL >= 1 then
begin
  //AssignFile(Log1, Logsti);
  for I := 0 to LogAntalL - 1 do
    begin
      Append(Log1);
      LogLinje := MemoStrings[I];
      Writeln(Log1,DateTimeToStr(now) + #9 + '[' + Dt + ']' + #9 + LogLinje);
    end;
  CloseFile(Log1);
  frmNote.memNew.Clear;
end;
end;

procedure TfrmNote.btnCloseClick(Sender: TObject);
begin
frmNote.Close;
end;

end.
